<%@page import="ContentManagers.RoleManagers.CustomerManager"%>
<%@page import="java.sql.ResultSet"%>


<div id="purchases_body" class="content_box">
    
    <%
    try{
         ResultSet rs = null;
         rs = new CustomerManager().getPurchases(session.getAttribute("username").toString());
         
         if(rs == null || rs.first()==false){
                     %> 
                     No purchases yet.
                    <% }
         else
         {   
            rs.beforeFirst();
            
            out.println("Your purchases<br><br>");
            out.println("<center><table class=\"purchases\" cellspacing=\"0\" ><tr><td>&nbsp;Timestamp</td><td>&nbsp;Product</td><td>&nbsp;Quantity</td></tr>");
            
            while(rs.next())
            {
                out.println("<tr><td>&nbsp;&nbsp;" + rs.getString("transaction_timestamp") + "&nbsp;&nbsp;</td><td>&nbsp;&nbsp;" + rs.getString("product_name") + "&nbsp;&nbsp;</td><td>&nbsp;&nbsp;" + rs.getString("quantity") + "&nbsp;&nbsp;</td></tr>");
            }
            
            out.println("</table></center>");
         }
         
         
        
    
        }catch(Exception e){ }
    
    
    
    
    
    %>
    
    
</div>